package com.example.mybatis;

public enum SexTypeEnum {
    MAN(1,"男"),
    WOMEN(2,"女");

    SexTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static SexTypeEnum getByValue(Integer value){
        SexTypeEnum[] values = values();
        for (SexTypeEnum sexTypeEnum : values) {
            if(sexTypeEnum.getValue().equals(value)){
                return sexTypeEnum;
            }
        }
        return null;
    }

    private Integer value;
    private String name;
    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
